/*
 * Copyright (C) 2010 EPRO
 */
package com.epro.dx.widget;

import android.view.View;
import android.widget.RatingBar;
import android.widget.TextView;

import com.epro.dx.R;

/**
 * 辅助获取评论列表adapter的子元素布局
 * @author cw55072
 * @version  [1.0, 2010-08-31]
 *
 */
public class CommentListAssistant
{
    
    private View baseView;
    
    private TextView commentTitle, commentPros, commentCons, commentOtherThoughts, commentBottomline, commentNickname,
        techLevel, ownershipStatus;
    
    private RatingBar priceRating, easeOfUseRating, buildQualityRating, valueRating, overallRating;
    
    public CommentListAssistant(View baseView)
    {
        this.baseView = baseView;
    }
    
    /**
     * 获取标题视图
     * @return
     */
    public TextView getCommentTitleView()
    {
        if (commentTitle == null)
        {
            commentTitle = (TextView)baseView.findViewById(R.id.commentTitle);
        }
        return commentTitle;
    }
    
    /**
     * 获取优点视图
     * @return
     */
    public TextView getCommentProsView()
    {
        if (commentPros == null)
        {
//            commentPros = (TextView)baseView.findViewById(R.id.commentPros);
        }
        return commentPros;
    }
    
    /**
     * 获取缺点视图
     * @return
     */
    public TextView getCommentConsView()
    {
        if (commentCons == null)
        {
//            commentCons = (TextView)baseView.findViewById(R.id.commentCons);
        }
        return commentCons;
    }
    
    /**
     * 获取其它看法视图
     * @return
     */
    public TextView getCommentOtherThoughtsView()
    {
        if (commentOtherThoughts == null)
        {
//            commentOtherThoughts = (TextView)baseView.findViewById(R.id.commentOtherThoughts);
        }
        return commentOtherThoughts;
    }
    
    /**
     * 获取结论视图
     * @return
     */
    public TextView getCommentBottomlineView()
    {
        if (commentBottomline == null)
        {
//            commentBottomline = (TextView)baseView.findViewById(R.id.commentBottomLine);
        }
        return commentBottomline;
    }
    
    //    /**
    //     * 获取用户名日期视图
    //     * @return
    //     */
    //    public TextView getCommentNicknameAndDateView()
    //    {
    //        if (commentNickname == null)
    //        {
    //            commentNickname = (TextView)baseView.findViewById(R.id.commentNicknameAndDate);
    //        }
    //        return commentNickname;
    //    }
    //    
    //    /**
    //     * 获取作者对产品的了解程度视图
    //     * @return
    //     */
    //    public TextView getTechLevelView()
    //    {
    //        if (techLevel == null)
    //        {
    //            techLevel = (TextView)baseView.findViewById(R.id.techLevel);
    //        }
    //        return techLevel;
    //    }
    
    /**
     * 获取对此物品的持有状态视图
     * @return
     */
    public TextView getOwnershipStatusView()
    {
        if (ownershipStatus == null)
        {
//            ownershipStatus = (TextView)baseView.findViewById(R.id.ownershipStatus);
        }
        return ownershipStatus;
    }
    
    /**
     * 获取价格评价视图
     * @return
     */
    public RatingBar getPriceRatingView()
    {
        if (priceRating == null)
        {
            priceRating = (RatingBar)baseView.findViewById(R.id.PriceRating);
        }
        return priceRating;
    }
    
    /**
     * 获取易用性评价视图
     * @return
     */
    public RatingBar getEaseOfUseRatingView()
    {
        if (easeOfUseRating == null)
        {
            easeOfUseRating = (RatingBar)baseView.findViewById(R.id.EaseOfUseRating);
        }
        return easeOfUseRating;
    }
    
    /**
     * 获取制作质量评价视图
     * @return
     */
    public RatingBar getBuildQualityRatingView()
    {
        if (buildQualityRating == null)
        {
            buildQualityRating = (RatingBar)baseView.findViewById(R.id.BuildQualityRating);
        }
        return buildQualityRating;
    }
    
    /**
     * 获取价值评价视图
     * @return
     */
    public RatingBar getValueRatingView()
    {
        if (valueRating == null)
        {
            valueRating = (RatingBar)baseView.findViewById(R.id.ValueRating);
        }
        return valueRating;
    }
    
    /**
     * 获取总体评价视图
     * @return
     */
    public RatingBar getOverallRatingView()
    {
        if (overallRating == null)
        {
            overallRating = (RatingBar)baseView.findViewById(R.id.overallRating);
        }
        return overallRating;
    }
    
}
